<template>
  <div class="view-image">
    <template v-if="editMode">
      <template v-if="imageURL">
        <img
          style="width:100%;height:100%;"
          :src="imageURL"
          @dragstart.prevent
          @dragover.prevent
          @drop.prevent
          :title="imgTitle"
        />
      </template>
      <q-icon v-else name="photo_size_select_actual" size="120px" color="light" />
    </template>
    <template v-else>
      <img
        v-if="imageURL"
        style="width:100%;height:100%;"
        :src="imageURL"
        @dragstart.prevent
        @dragover.prevent
        @drop.prevent
        :title="imgTitle"
      />
    </template>
  </div>
</template>

<script>
import BaseView from './View';
export default {
  name: 'view-image',
  extends: BaseView,
  props: {

  },
  computed: {
    imageURL: function () {
      return this.detail.style.url ? this.detail.style.url : '';
    },
    imgTitle () {
      return this.detail.style.title ? this.detail.style.title : '';
    }
  },
  components: {},
  data () {
    return {
    }
  },
  methods: {
  }

}
</script>

<style lang="scss">
.view-image {
  height: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>